package com.example.extend;

public class Cat extends Animal{
    public Cat(int Myid, String Myname){
        super(Myid,Myname); // 调用父类的构造器，将值进行初始化
    }
    // 方法重写，会覆盖父类的eat
    public void eat(){
        System.out.println("cat eat");
    }
    public void bark(){
        System.out.println("狗可以吠叫");
    }

    public static void main(String[] args) {
        Cat c = new Cat(20,"汤姆");
        c.eat();
        c.bark();
//        c.introduction();
    }
}
